//
//  TrackMap.m
//  MessangerSkeleton
//
//  Created by User-15 on 4/14/14.
//  Copyright (c) 2014 IOTrainingCamp. All rights reserved.
//

#import "TrackMap.h"
#import "cocos2d.h"
#import "Configuration.h"

@implementation TrackMap

- (id)init
{
    self = [super initWithFile:kMapName];
    if (self) {
        self.scale = kMapScale;

    }
    return self;
}

-(void)update:(CCTime)dt andSpeed: (CGPoint) speed{
    self.position = ccp(self.position.x - speed.x*dt, self.position.y - speed.y*dt );
    
    if (self.position.x <= [[CCDirector sharedDirector] viewSize].width - self.contentSize.width * self.scale){
        self.position = CGPointZero;
    }
}

-(void)populateMap{
    // TODO: depending on the level ads appropreate GameObjects
}

@end
